package cn.bupt.adt.service.impl;



import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;

import com.fasterxml.jackson.databind.ObjectMapper;

import cn.bupt.adt.constant.Constants;
import cn.bupt.adt.dao.autogenerate.InspectViewMapper;
import cn.bupt.adt.dao.autogenerate.InspectionItemMapper;
import cn.bupt.adt.entity.autogenerate.InspectView;
import cn.bupt.adt.entity.autogenerate.InspectionItem;
import cn.bupt.adt.entity.autogenerate.Institution;
import cn.bupt.adt.service.IInspectionItemsService;
import cn.bupt.adt.util.ImageUtil;

@Service
public class InspectionItemsServiceImpl implements IInspectionItemsService{
	@Autowired
	InspectViewMapper inspectViewMapper;
	
	@Autowired
	InspectionItemMapper inspectionItemMapper;
	
	public boolean addInspection(InspectionItem ins,HttpServletRequest request) {
		MultipartHttpServletRequest req = (MultipartHttpServletRequest) request;
		//获取一级类别，获取二级类别
		//检查项目表插入
		int i = inspectionItemMapper.insert(ins);
		return i == 1;
	}
	@Override
	public boolean deleteInspectById(int id) {
		return inspectionItemMapper.deleteByPrimaryKey(id) == 1;
	}
	@Override
	public boolean modifyInspectItem(InspectionItem ins, HttpServletRequest request) {
		MultipartHttpServletRequest req = (MultipartHttpServletRequest) request;
		return inspectionItemMapper.updateByPrimaryKeySelective(ins) == 1;
	}
}
